Skip to content

fix: only search on enter keypress#1226

Open
gameroman wants to merge 9 commits intonpmx-dev:mainfrom
gameroman:fix-search
Open

fix: only search on enter keypress#1226
gameroman wants to merge 9 commits intonpmx-dev:mainfrom
gameroman:fix-search

Conversation

@gameroman
Copy link
Contributor

@gameroman gameroman commented Feb 8, 2026

Searches on enter key press

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 8, 2026 7:54pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 8, 2026 7:54pm
npmx-lunaria Ignored Ignored Feb 8, 2026 7:54pm

Request Review

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Header/SearchBox.vue 0.00% 5 Missing and 6 partials ⚠️

📢 Thoughts on this report? Let us know!

@gameroman gameroman marked this pull request as ready for review February 8, 2026 17:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

Debounce-based URL synchronisation and the debounce import are removed. In app/components/Header/SearchBox.vue, URL updates now occur only when the current route is 'search' via router.replace; the input watcher calls updateUrlQuery only on the 'search' route; URL-to-input sync updates searchQuery only when the normalized URL value differs; submit trims the query, avoids navigating from local-filter pages when empty, flushes the debounced updater if on 'search', and otherwise navigates to 'search' with { q: trimmedQuery }. In app/pages/index.vue the input handler, its binding and recursive retry logic are removed and search() always passes { q: query }. Tests now trigger navigation by sending Enter after typing in two e2e specs instead of relying on debounce timing.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description 'Searches on enter key press' directly relates to the changeset, which removes debounce-based automatic search navigation and implements explicit Enter key-triggered search across multiple components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

@whitep4nth3r whitep4nth3r changed the title fix fix: only search on enter keypress Feb 8, 2026
@gameroman
Copy link
Contributor Author

I need to fix the tests now

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/components/Header/SearchBox.vue (1)

47-49: Consider adding a type guard for route.name.

route.name can be string | symbol | null | undefined, whilst pagesWithLocalFilter is a Set<string>. Although Set.has() handles mismatched types gracefully at runtime (returning false), an explicit type check would satisfy strict type safety. The same pattern appears on line 59.

♻️ Proposed type-safe guard
-    if (pagesWithLocalFilter.has(route.name)) {
+    if (typeof route.name === 'string' && pagesWithLocalFilter.has(route.name)) {

Apply the same pattern at line 59.

As per coding guidelines: "Ensure you write strictly type-safe code".

@ghostdevv
Copy link
Contributor

I think this is a duplicate of #1107 unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants